#!/usr/bin/python
# -*- coding: UTF-8 -*-
import os
"""
    wins版本
"""
def process_exist(proc_name):
    "判断进程是否存在 server_script需要配置"
    #is_exist =False
    #这里是wins上面的命令proc_name'""
    server_script ="E:\\TestPy\\denaDaemon\\appiumServer.py"
    shell_cmd ="tasklist |findstr "+proc_name
    res =os.system(shell_cmd)
    print(res)
    if res ==0:
        print("进程存在")
    else:
        print("进程不存在,正在启动")
        shell_cmd = "py -3 "+server_script
        res =os.system(shell_cmd)
        # if res =="Waiting for connecting ......":
        #     print("启动进程成功")
process_exist("py.exe")